/**
 * Created by Administrator on 2018/6/27, 027.
 */

export default {
  username: state => state.username ? state.username : window.sessionStorage.getItem('username'),
  title: state => state.title,
  checkedMenuList: state => state.checkedMenuList,
  bugListOpt: state => state.bugListOpt,
  appId: state => state.appId ? state.appId : window.sessionStorage.getItem('appId'),
  bugAppId: state => {
    if (state.bugAppId) {
      return state.bugAppId
    } else {
      state.bugAppId = window.sessionStorage.getItem('bugAppId')
      return state.bugAppId
    }
  },
  bugAppObj: state => state.bugAppObj ? state.bugAppObj : window.sessionStorage.getItem('bugAppObj'),
  workspaceId: state => state.workspaceId ? state.workspaceId : window.sessionStorage.getItem('workspaceId'),
  workspaceName: state => state.workspaceName ? state.workspaceName : window.sessionStorage.getItem('workspaceName'),
  gateWayId: state => state.gateWayId,
  custTags: state => state.custTags,
  selectTagPageNo: state => state.selectTagPageNo,
  sysName: state => state.sysName ? state.sysName : window.sessionStorage.getItem('sysName'),
  sysNo: state => state.sysNo ? state.sysNo : window.sessionStorage.getItem('sysNo'),
  v3AppId: state => state.v3AppId ? state.v3AppId : window.sessionStorage.getItem('v3AppId'),
  v3platform: state => state.v3platform ? state.v3platform : window.sessionStorage.getItem('v3platform'),
  v3AppTitle: state => state.v3AppTitle ? state.v3AppTitle : window.sessionStorage.getItem('v3AppTitle'),
  v3AppKey: state => state.v3AppKey ? state.v3AppKey : window.sessionStorage.getItem('v3AppKey'),
  v3SecretKey: state => state.v3SecretKey ? state.v3SecretKey : window.sessionStorage.getItem('v3SecretKey'),
  path: state => state.path ? state.path : window.sessionStorage.getItem('path'),
  appdatalist: state => state.appdatalist ? state.appdatalist : window.sessionStorage.getItem('appdatalist'),
  resresultList: state => state.resresultList ? state.resresultList : window.sessionStorage.getItem('resresultList'),
  pushmsgId: state => state.pushmsgId ? state.pushmsgId : window.sessionStorage.getItem('pushmsgId'),
  storageId: state => state.storageId ? state.storageId : window.sessionStorage.getItem('storageId'),
  systemList: state => {
    if (state.systemList && state.systemList.length > 0) {
      return JSON.parse(state.systemList)
    } else {
      return JSON.parse(window.sessionStorage.getItem('systemList'))
    }
  },
  rbac: state => state.rbac ? state.rbac : window.sessionStorage.getItem('rbac'),
  loginFlag: state => state.loginFlag ? state.loginFlag : window.sessionStorage.getItem('loginFlag')
}
